**************************************************************************************************
*** This do file creates the replication results for 
*** Democracy and Climate Change Policies: Is History Important?							 	*/
*** Per G. Fredriksson (University of Louisville)																		*/
*** Eric Neumayer (LSE)																			*/
*** 																							*/
*** Published in: Ecological Economics,95, 2014, pp. 11-19 													*/
**************************************************************************************************
**************************************************************************************************
/* Note: 
You have to change "local DIR" to the directory you copy the original stata files contained 	*/
/* in the zip file and then run the do file. 													*/
**************************************************************************************************

drop _all
clear matrix
clear mata

capture net install outreg2, from(http://fmwww.bc.edu/RePEc/bocode/o)			/* checks whether outreg2 is installed 		*/

***********************************************************************************
local DIR = "C:\Research\Environment\Political Economy of the Environment\"  /*change relative path to the directory where the files are located */
cd "`DIR'"
***********************************************************************************

use "Article for EE (climate).dta", replace


*** Table 1: Summary statistics
quietly reg  climi   kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score  polity2    if polity2!=., robust
sum climi kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score  polity2 demcap_ab0_sc_1800onw demcap_ab0_sc_1900onw demcap_ab0_sc_1950onw demcap_ab5_sc_1800onw demcap_ab5_sc_1900onw demcap_ab5_sc_1950onw cdi trade_gdp  corrup_est stabs  s_island  leg_french leg_socialist leg_german leg_scandivanian   if e(sample)

quietly reg   glo_col   kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score  polity2, robust
sum glo_col if e(sample)



*** Table 2

reg  climi   kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score  polity2    if polity2!=., robust
outreg2 using table2 , excel  replace


reg  climi   kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score     demcap_ab0_sc_1800onw if polity2!=., robust
outreg2 using table2 , excel  append



reg  climi   kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score   polity2  demcap_ab0_sc_1800onw if polity2!=., robust
outreg2 using table2 , excel  append



reg  climi   kyoto_pledge2 non_annex1 gdp_pc_ppp heritage_score   polity2  demcap_ab0_sc_1800onw if polity2!=., robust
outreg2 using table2 , excel  append


reg  climi   kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score   polity2  demcap_ab0_sc_1800onw if polity2!=. & inc_high_oecd==0, robust
outreg2 using table2 , excel  append



reg  climi   kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score     demcap_ab0_sc_1900onw if polity2!=., robust
outreg2 using table2 , excel  append



reg  climi   kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score     demcap_ab0_sc_1950onw if polity2!=., robust
outreg2 using table2 , excel  append



reg  climi   kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score     demcap_ab5_sc_1800onw if polity2!=., robust
outreg2 using table2 , excel  append



reg  climi   kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score     demcap_ab5_sc_1900onw if polity2!=., robust
outreg2 using table2 , excel  append


reg  climi   kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score     demcap_ab5_sc_1950onw if polity2!=., robust
outreg2 using table2 , excel  append



*** Table 3: Further control variables


* Add climate vulnerability
reg  climi cdi   kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score     demcap_ab0_sc_1800onw if polity2!=., robust
outreg2 using table3 , excel  replace

* Add trade openness
reg  climi trade_gdp   kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score     demcap_ab0_sc_1800onw if polity2!=., robust
outreg2 using table3 , excel  append

* Add control of corruption
reg  climi corrup_est   kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score     demcap_ab0_sc_1800onw if polity2!=., robust
outreg2 using table3 , excel  append

* Add political stability
reg  climi stabs     kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score     demcap_ab0_sc_1800onw if polity2!=., robust
outreg2 using table3 , excel  append

* Add small island dummy
reg  climi s_island    kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score     demcap_ab0_sc_1800onw if polity2!=., robust
outreg2 using table3 , excel  append

* Add legal origin dummies (British omitted category)
reg  climi  leg_french leg_socialist leg_german leg_scandivanian    kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score     demcap_ab0_sc_1800onw if polity2!=., robust
outreg2 using table3 , excel  append

* Add all together
reg  climi cdi trade_gdp  corrup_est stabs  s_island  leg_french leg_socialist leg_german leg_scandivanian   kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score     demcap_ab0_sc_1800onw if polity2!=., robust
outreg2 using table3 , excel  append




*** Table 4: IV estimates

ivreg2  climi  kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score   (demcap_ab0_sc_1800onw  =  iv_demcap_ab0_sc_1800_contig  ) if polity2!=., robust first
outreg2 using table4 , excel  replace

ivreg2  climi  kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score   (demcap_ab0_sc_1900onw  =  iv_demcap_ab0_sc_1900_contig  ) if polity2!=., robust first
outreg2 using table4 , excel  append

ivreg2  climi  kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score   (demcap_ab0_sc_1950onw  =  iv_demcap_ab0_sc_1950_contig  ) if polity2!=., robust first
outreg2 using table4 , excel  append


ivreg2  climi  kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score   (demcap_ab5_sc_1800onw  =  iv_demcap_ab5_sc_1800_contig  ) if polity2!=., robust first
outreg2 using table4 , excel  append

ivreg2  climi  kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score   (demcap_ab5_sc_1900onw  =  iv_demcap_ab5_sc_1900_contig  ) if polity2!=., robust first
outreg2 using table4 , excel  append

ivreg2  climi  kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score   (demcap_ab5_sc_1950onw  =  iv_demcap_ab5_sc_1950_contig  ) if polity2!=., robust first
outreg2 using table4 , excel  append


***  Table 5: Regional jackknives
reg  climi   if polity2!=. , robust 
outreg2 using table5, excel  replace
foreach region in  reg_eap reg_eca reg_sa reg_mena reg_ssa reg_we reg_na reg_lac {
reg  climi   kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score    demcap_ab0_sc_1800onw if polity2!=. & `region'==0, robust 
outreg2 using table5, excel  append
}



*** Table 6: Global env cooperation as DV


reg   glo_col   kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score  polity2, robust
outreg2 using table6 , excel  replace


reg   glo_col   kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score   polity2  demcap_ab0_sc_1800onw if e(sample), robust
outreg2 using table6 , excel  append

reg   glo_col   kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score     demcap_ab0_sc_1800onw if e(sample), robust
outreg2 using table6 , excel  append

ivreg2   glo_col  kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score (demcap_ab0_sc_1800onw  =  iv_demcap_ab0_sc_1800_contig  ) if e(sample), robust first
outreg2 using table6 , excel  append

***  Table 7: Disaggregating democracy

reg  climi   kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score      xconst_cap_ab5_1800onw xconst  polcomp_cap_ab8_1800onw polcomp if polity2!=., robust
outreg2 using table7 , excel  replace


reg  climi   kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score      xconst_cap_ab5_1900onw xconst  polcomp_cap_ab8_1900onw polcomp if polity2!=., robust
outreg2 using table7 , excel  append

reg  climi   kyoto_pledge2 non_annex1 co2pc gdp_pc_ppp heritage_score      xconst_cap_ab5_1950onw xconst  polcomp_cap_ab8_1950onw polcomp if polity2!=., robust
outreg2 using table7 , excel  append


